3 research outputs found

    A computational solution for the software refactoring problem: from a formalism toward an optimization approach

    Get PDF
    Abstract: Software Refactoring consists in reconstructing the code design of an object- oriented system without affecting the external functionality. Common refactoring tasks, in the initial steps, detect the source code components to be affected and recommend accurate Refactoring Operations to be applied to those components (an estimation problem). In this document, the author defines, develops and evaluates an Artificial Refactoring Hybrid Adaptive Technique (ArHaT) to estimate refactorings as a combi- natorial model. The author investigated whether Refactoring Impact Prediction yields sets of artificial refactoring operations before implementing them into the code. ArHaT estimates the sets of Refactoring Operations according to some predefined weight values of the quality metrics. The weight values or coefficients capture the developer error-prone knowledge of the code in the objective function. The author conducted several fitness performance evaluations in two open software systems and organized them as a set of experiments. The goal of the experiments is to minimize a ratio between impacted quality metrics and actual quality metrics. Hill-Climbing, Simulated Annealing, and Hybrid Adaptive Evolutionary Algorithm assembled feasible refactorings, yet the latter accomplished the best performance. This research establishes the fundamentals of the automation of the refactoring problem and contributes to reducing the gap between the software defect prediction and the software refactoring.Maestrí

    Studying the Usage of Text-To-Text Transfer Transformer to Support Code-Related Tasks

    Full text link
    Deep learning (DL) techniques are gaining more and more attention in the software engineering community. They have been used to support several code-related tasks, such as automatic bug fixing and code comments generation. Recent studies in the Natural Language Processing (NLP) field have shown that the Text-To-Text Transfer Transformer (T5) architecture can achieve state-of-the-art performance for a variety of NLP tasks. The basic idea behind T5 is to first pre-train a model on a large and generic dataset using a self-supervised task ( e.g: filling masked words in sentences). Once the model is pre-trained, it is fine-tuned on smaller and specialized datasets, each one related to a specific task ( e.g: language translation, sentence classification). In this paper, we empirically investigate how the T5 model performs when pre-trained and fine-tuned to support code-related tasks. We pre-train a T5 model on a dataset composed of natural language English text and source code. Then, we fine-tune such a model by reusing datasets used in four previous works that used DL techniques to: (i) fix bugs, (ii) inject code mutants, (iii) generate assert statements, and (iv) generate code comments. We compared the performance of this single model with the results reported in the four original papers proposing DL-based solutions for those four tasks. We show that our T5 model, exploiting additional data for the self-supervised pre-training phase, can achieve performance improvements over the four baselines.Comment: Accepted to the 43rd International Conference on Software Engineering (ICSE 2021

    A computational solution for the software refactoring problem: a formalism toward an optimization approach

    Get PDF
    Software Refactoring consists in reconstructing the code design of an object-oriented system without affecting the external functionality. Common refactoring tasks, in the initial steps, detect the source code components to be affected and recommend accurate Refactoring Operations to be applied to those components (an estimation problem). In this document, the author defines, develops and evaluates an Artificial Refactoring Hybrid Adaptive Technique (ArHaT) to estimate refactorings as a combi- natorial model. The author investigated whether Refactoring Impact Prediction yields sets of artificial refactoring operations before implementing them into the code. ArHaT estimates the sets of Refactoring Operations according to some predefined weight values of the quality metrics. The weight values or coefficients capture the developer error-prone knowledge of the code in the objective function. The author conducted several fitness performance evaluations in two open software systems and organized them as a set of experiments. The goal of the experiments is to minimize a ratio between impacted quality metrics and actual quality metrics. Hill-Climbing, Simulated Annealing, and Hybrid Adaptive Evolutionary Algorithm assembled feasible refactorings, yet the latter accomplished the best performance. This research establishes the fundamentals of the automation of the refactoring problem and contributes to reducing the gap between the software defect prediction and the software refactoring.Maestrí
    corecore